﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcDemo.Controllers
{
    public class TestController : Controller
    {
        //
        // GET: /Test/

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 可以通过Url.RouteUrl动态拼接一个url
        /// </summary>
        /// <returns></returns>
        public ActionResult UsingUrlInAction()
        {
            string url= Url.RouteUrl("Default", new { controller = "aa", action = "bb", id ="cc"});
            this.ViewBag.urlPassed = url;
            return View();
        }
    }
}
